//
//  ScrollViewDemo.swift
//  SwiftUIDemo
//
//  Created by Tilt Wang on 2025/6/26.
//

import SwiftUI

struct ScrollViewDemo: View {
    var body: some View {
        
        ScrollView(.vertical, showsIndicators: true, content: {
            LazyVStack {
                ForEach(0..<10) { index in
                    ScrollView(.horizontal, showsIndicators: true, content: {
                        LazyHStack {
                            ForEach(0..<20) { index in
                                RoundedRectangle(cornerRadius: 25.0)
                                    .fill(Color.purple)
                                    .frame(width: 200, height: 150)
                                    .shadow(radius: 10)
                                    .padding()
                            }
                        }
                    })
                }
            }
        })
//        ScrollView {
//            VStack {
//                ForEach(0..<50) { index in
//                    Rectangle()
//                        .frame(height: 300)
//                }
//            }
//        }
    }
}

#Preview {
    ScrollViewDemo()
}
